package com.zjw.core.collection;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Artist implements Comparable<Artist>{

    public Integer id;

    public String name;

    public Integer age;

    @Override
    public int compareTo(Artist o) {
        if(this.getAge().compareTo(o.getAge()) > 0){
            return 1;
        }else if(this.getAge().compareTo(o.getAge()) == 0){
            return 0;
        }else {
            return -1;
        }
    }
}
